<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="<?=base_url('publics/admin');?>/lib/html5.js"></script>
<script type="text/javascript" src="<?=base_url('publics/admin');?>/lib/respond.min.js"></script>
<script type="text/javascript" src="<?=base_url('publics/admin');?>/lib/PIE_IE678.js"></script>
<![endif]-->
<link href="<?=base_url('publics/admin');?>/style/styles.css" rel="stylesheet" type="text/css" />
<link href="<?=base_url('publics/admin');?>/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="<?=base_url('publics/admin');?>/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="<?=base_url('publics/admin');?>/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="<?=base_url('publics/admin');?>/lib/font-awesome/font-awesome.min.css" rel="stylesheet" type="text/css" />
<!--[if IE 7]>
<link href="<?=base_url('publics/admin');?>/lib/font-awesome/font-awesome-ie7.min.css" rel="stylesheet" type="text/css" />
<![endif]-->
<link href="<?=base_url('publics/admin');?>/lib/iconfont/iconfont.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="<?=base_url('publics/admin');?>/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>添加用户</title>
</head>
<body>
<div id="main_right">
  <div id="r_title">
    <div id="r_title_content">
      用户管理 &gt; 增加用户
    </div>
  </div>
  
  <div id="r_menu">
    <ul>
      <li><a class="btn btn-primary radius" href="<?=base_url('manage/user');?>">返回列表</a></li>
    </ul>
  </div>
    <div class="line_white"></div>
  <div id="r_list">
   <?php echo validation_errors(); ?>
    <form action="" method="post" class="form form-horizontal" id="form-user-add" onsubmit="return na_check_form();" >
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>请选择角色：</label>
      <div class="formControls col-5">
       <select name="user_role_id" id="user_role_id">
			<option value="0">|_&nbsp;请选择角色</option>
			<?php foreach ($role as $k => $val):?>
			<option value="<?=$val['role_id'];?>">|_&nbsp;<?=$val['role_name'];?></option>
			<?php endforeach;?>
		</select>
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>用户名：</label>
      <div class="formControls col-5">
      <input type="text" size="30" name="user_name" id="user_name" placeholder=""  datatype="*1-50" class="input-text" nullmsg="用户名不能为空"/>
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>密码：</label>
      <div class="formControls col-5">
      <input type="password" size="30" name="user_password" id="user_password" placeholder=""  datatype="*6-20" class="input-text" nullmsg="密码不能为空"/>
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>确认密码：</label>
      <div class="formControls col-5">
       <input type="password" size="30" name="user_password1" id="user_password1" placeholder=""  datatype="*6-20" class="input-text" nullmsg="确认密码不能为空"/>
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>用户昵称：</label>
      <div class="formControls col-5">
        <input type="text" size="30" name="user_nickname" id="user_nickname" placeholder=""  datatype="*1-20" class="input-text" nullmsg="用户昵称不能为空"/>
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <div class="col-9 col-offset-3">
        <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
      </div>
    </div>
  </form>
  </div>
</div>
<script type="text/javascript" src="<?=base_url('publics/admin');?>/lib/jquery.min.js"></script> 
<script type="text/javascript" src="<?=base_url('publics/admin');?>/lib/icheck/jquery.icheck.min.js"></script> 
<script type="text/javascript" src="<?=base_url('publics/admin');?>/lib/Validform_v5.3.2.js"></script> 
<script type="text/javascript" src="<?=base_url('publics/admin');?>/js/H-ui.js"></script> 
<script type="text/javascript" src="<?=base_url('publics/admin');?>/js/H-ui.admin.js"></script> 
<script type="text/javascript">
$(function(){
	$("#form-menu-add").Validform({
		tiptype:2,
	});
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
});
function na_check_form()
{

	// 检查角色的选择情况
	var user_role_id=$('#user_role_id').val();
	if(user_role_id == 0)
	{
		alert('请选择角色');
		return false;
	}

	// 检查密码
	if(na_check_strlength('user_password',6,20))
	{
		alert('密码至少要为6-20个字符');
		$('#user_password').focus();
		return false;
	}

	// 检查两次输入的密码是否一致
	if(na_check_same('user_password','user_password1'))
	{
		alert('两次输入的密码不一致，请重新输入！');
		$('#user_password1').focus();
		return false;
	}

	
}
</script> 
</body>
</html>